<?php
session_start(); 
include_once '../config/config.php';
include_once '../classes/ControllerUsers.php';
if(!isset($_POST['ok'])) {
	echo"
	<html>
	<head>
	<title>Login page</title>
	</head>
	<body>
	<table width='100%' height='100%'>
	<form method='POST' action='login.php'>
	<tr><td align=center>
	<table>
	<tr><td>
	<table>
	<tr><td>Login:</td><td><input type='text'
        name='login' size='15'></td></tr>
	<tr><td>Password:</td><td><input
        type='password' name='password' size='15'></td></tr>
	</table>
	</td></tr>
	<tr><td align=center><input type='submit' name='ok'
        value='login'></td></tr>
	</table>
	</td></tr>
	</form>
	</table>
	</body>
	</html>
	";
}
else{	
	$loginUser = new ControllerUsers();
	$loginUser->loginUser($_POST['login'], md5($_POST['password']));
	
}